/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    overflow: hidden;
}

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
}

.header h1 {
    color: #4a5568;
    font-size: 1.8rem;
    font-weight: 600;
}

.controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* 按钮样式 */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

/* 搜索输入框 */
.search-input {
    padding: 0.5rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    width: 200px;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 主内容区域 */
.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 侧边栏 */
.sidebar {
    width: 350px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    overflow-y: auto;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
}

.panel {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.panel h3 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* 统计信息 */
.stats {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f7fafc;
    border-radius: 6px;
}

.stat-label {
    color: #4a5568;
    font-weight: 500;
}

.stat-value {
    color: #667eea;
    font-weight: 600;
    font-size: 1.1rem;
}

/* 节点详情 */
.node-details {
    min-height: 100px;
}

.placeholder {
    color: #a0aec0;
    font-style: italic;
    text-align: center;
    padding: 2rem 0;
}

.node-info {
    background: #f7fafc;
    border-radius: 8px;
    padding: 1rem;
}

.node-info h4 {
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.node-property {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.property-key {
    font-weight: 500;
    color: #4a5568;
}

.property-value {
    color: #2d3748;
}

/* Cypher查询区域 */
#cypherQuery {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 1rem;
}

#cypherQuery:focus {
    outline: none;
    border-color: #667eea;
}

.query-result {
    margin-top: 1rem;
    max-height: 200px;
    overflow-y: auto;
    background: #f7fafc;
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

/* 移除3D相关样式，恢复2D图谱样式 */

/* 图谱容器 */
.graph-container {
    flex: 1;
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

#graph {
    width: 100%;
    height: 100%;
    cursor: grab;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
}

#graph:active {
    cursor: grabbing;
}

/* 图谱节点和边的样式 */
.node {
    cursor: pointer;
    transition: all 0.3s ease;
}

.node:hover {
    stroke-width: 3px;
}

.node.selected {
    stroke: #667eea;
    stroke-width: 4px;
}

.link {
    stroke: #999;
    stroke-opacity: 0.6;
    stroke-width: 2px;
    transition: all 0.3s ease;
}

.link:hover {
    stroke-opacity: 1;
    stroke-width: 3px;
}

.node-label {
    font-size: 12px;
    font-weight: 500;
    fill: #2d3748;
    text-anchor: middle;
    pointer-events: none;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

.relationship-label {
    font-size: 10px;
    fill: #4a5568;
    text-anchor: middle;
    pointer-events: none;
    font-weight: 500;
}

/* 移除3D控制面板相关样式 */
/* 删除 .controls-3d, .control-item, .slider 等3D相关样式 */

/* 加载动画 */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem 3rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    font-size: 1.1rem;
    color: #4a5568;
    z-index: 100;
}

.loading.hidden {
    display: none;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #2d3748;
    font-size: 1.3rem;
}

.close {
    color: #a0aec0;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #4a5568;
}

.modal-body {
    padding: 1.5rem;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #4a5568;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 3000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.notification.error {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
}

.notification.info {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
}

/* 图谱节点和边的样式 */
.node {
    cursor: pointer;
    transition: all 0.3s ease;
}

.node:hover {
    stroke-width: 3px;
}

.node.selected {
    stroke: #667eea;
    stroke-width: 4px;
}

.link {
    stroke: #999;
    stroke-opacity: 0.6;
    stroke-width: 2px;
    transition: all 0.3s ease;
}

.link:hover {
    stroke-opacity: 1;
    stroke-width: 3px;
}

.node-label {
    font-size: 12px;
    font-weight: 500;
    fill: #2d3748;
    text-anchor: middle;
    pointer-events: none;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

.relationship-label {
    font-size: 10px;
    fill: #4a5568;
    text-anchor: middle;
    pointer-events: none;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .sidebar {
        width: 100%;
        height: 40vh;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .graph-container {
        height: 60vh;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}





/* 小按钮样式 */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* 查询结果区域样式优化 */
.query-result {
    max-height: 300px;
    overflow-y: auto;
}

.query-result pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 0.5rem;
    margin: 0.5rem 0;
    font-size: 0.75rem;
    line-height: 1.2;
}
/* 在现有CSS文件末尾添加以下样式 */

/* 连接状态样式 */
.connection-status {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f7fafc;
    border-radius: 6px;
}

.status-label {
    color: #4a5568;
    font-weight: 500;
}

.status-value {
    font-weight: 600;
    font-size: 0.9rem;
}

.status-value.connected {
    color: #48bb78;
}

.status-value.disconnected {
    color: #f56565;
}

.status-value.connecting {
    color: #ed8936;
}

/* 表单帮助文本 */
.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #718096;
    font-style: italic;
}

/* 连接测试结果 */
.connection-test-result {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    display: none;
}

.connection-test-result.success {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #276749;
    display: block;
}

.connection-test-result.error {
    background: #fed7d7;
    border: 1px solid #feb2b2;
    color: #c53030;
    display: block;
}

.connection-test-result.testing {
    background: #fefcbf;
    border: 1px solid #f6e05e;
    color: #744210;
    display: block;
}